package com.platform.dao.mybatis.impl;

import com.platform.dao.DepartmentDao;
import com.platform.dao.mybatis.mapper.DepartmentMapper;
import com.platform.domain.model.Department;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
* Department
*
* User: wangyang
* DateTime: 2012-10-08 16:11:49
*
*/
@Service("departmentDao")
public class DepartmentDaoImpl implements DepartmentDao {

    @Resource
    private DepartmentMapper departmentMapper;

    /**
    *
    * 根据主键查询Department对象
    *
    * @param deptId
    * @return Department对象
    */
    @Override
    public Department selectByPrimaryKey(String deptId) throws Exception {
        return departmentMapper.selectByPrimaryKey(deptId);
    }

    /**
    *
    * 根据查询条件查询符合条件的Department对象
    *
    * @param department
    * @return 符合条件的Department对象List
    */
    @Override
    public List<Department> select(Department department) throws Exception {
        return departmentMapper.select(department);
    }

    /**
    *
    * 根据主键删除Department对象
    *
    * @param deptId
    * @return 影响条件数
    */
    @Override
    public int deleteByPrimaryKey(String deptId) throws Exception {
        return departmentMapper.deleteByPrimaryKey(deptId);
    }

    /**
    *
    * 根据条件删除符合条件的Department对象
    *
    * @param department
    * @return 影响条件数
    */
    @Override
    public int delete(Department department) throws Exception {
        return departmentMapper.delete(department);
    }

    /**
    *
    * 插入Department对象
    *
    * @param department
    * @return 影响条件数
    */
    @Override
    public int insert(Department department) throws Exception {
        return departmentMapper.insert(department);
    }

    /**
    *
    * 更新Department对象
    *
    * @param department
    * @return 影响条件数
    */
    @Override
    public int update(Department department) throws Exception {
        return departmentMapper.update(department);
    }
}
